//
//  CLSeverController.m
//  CareLink
//
//  Created by clinging on 16/8/20.
//  Copyright © 2016年 Seven Team. All rights reserved.
//

#import "CLSeverController.h"

#import "MyActivityIndicatorView.h"
@interface CLSeverController ()

@end

@implementation CLSeverController

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];

    UIImageView* imageView = [[UIImageView alloc] init];
    imageView.image = [UIImage imageNamed:@"banner"];
    [self.view addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker* make) {
        make.left.right.bottom
            .top.offset(0);
    }];
    
    MyActivityIndicatorView *myActivity = [[MyActivityIndicatorView alloc]init];
    [self.view addSubview:myActivity];
    [myActivity startAnimating];

    UIApplication* app = [UIApplication sharedApplication];
    if ([app openURL:[NSURL URLWithString:@"https://www.baidu.com"]]) {
        [myActivity stopAnimating];
        [app openURL:[NSURL URLWithString:@"https://www.baidu.com"]];
    }
    
}

- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
    if (indexPath.row == 1) {
        UIApplication* app = [UIApplication sharedApplication];

        [app openURL:[NSURL URLWithString:@"https://www.baidu.com"]];
    }
}

@end
